﻿using Microsoft.AspNetCore.Mvc;
using RuYiAdmin.Net.Entity.BusinessEntity.SystemManagement;
using RuYiAdmin.Net.Entity.BusinessEnum;
using RuYiAdmin.Net.Entity.CoreEntity;
using RuYiAdmin.Net.Service.BusinessService.SystemManagement.Language;
using RuYiAdmin.Net.WebApi.AppCode.Base;
using RuYiAdmin.Net.WebApi.AppCode.Filter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace RuYiAdmin.Net.WebApi.Controllers.SystemManagement
{
    /// <summary>
    /// 多语管理控制器
    /// </summary>
    public class LanguageManagementController : BaseController<SysLanguage>
    {
        /// <summary>
        /// 多语管理业务接口实例
        /// </summary>
        private readonly ILanguageService languageService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="languageService"></param>
        public LanguageManagementController(ILanguageService languageService) : base(languageService)
        {
            this.languageService = languageService;
        }

        /// <summary>
        /// 查询多语列表
        /// </summary>
        /// <param name="queryCondition">查询条件</param>
        /// <returns>ActionResult</returns>
        [HttpPost]
        [Log(OperationType.QueryList)]
        [Permission("language:query:list")]
        public IActionResult Post(QueryCondition queryCondition)
        {
            var actionResult = this.languageService.SqlQuery(queryCondition, "sqls:sql:query_syslanguage");
            return Ok(actionResult);
        }
    }
}
